package com.ruoyi.basedata.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.basedata.mapper.UserChangeXbLogMapper;
import com.ruoyi.basedata.domain.UserChangeXbLog;
import com.ruoyi.basedata.service.IUserChangeXbLogService;

/**
 * 小过户记录Service业务层处理
 *
 * @author TsingYu
 * @date 2024-07-13
 */
@Service
public class UserChangeXbLogServiceImpl implements IUserChangeXbLogService {

    private final UserChangeXbLogMapper userChangeXbLogMapper;

    public UserChangeXbLogServiceImpl(UserChangeXbLogMapper userChangeXbLogMapper) {
        this.userChangeXbLogMapper = userChangeXbLogMapper;
    }

    /**
     * 查询小过户记录
     *
     * @param id 小过户记录主键
     * @return 小过户记录
     */
    @Override
    public UserChangeXbLog selectUserChangeXbLogById(Long id) {
        return userChangeXbLogMapper.selectUserChangeXbLogById(id);
    }

    /**
     * 查询小过户记录列表
     *
     * @param userChangeXbLog 小过户记录
     * @return 小过户记录
     */
    @Override
    public List<UserChangeXbLog> selectUserChangeXbLogList(UserChangeXbLog userChangeXbLog) {
        return userChangeXbLogMapper.selectUserChangeXbLogList(userChangeXbLog);
    }

    /**
     * 新增小过户记录
     *
     * @param userChangeXbLog 小过户记录
     * @return 结果
     */
    @Override
    public int insertUserChangeXbLog(UserChangeXbLog userChangeXbLog) {
        userChangeXbLog.setCreateTime(DateUtils.getNowDate());
        return userChangeXbLogMapper.insertUserChangeXbLog(userChangeXbLog);
    }

    /**
     * 修改小过户记录
     *
     * @param userChangeXbLog 小过户记录
     * @return 结果
     */
    @Override
    public int updateUserChangeXbLog(UserChangeXbLog userChangeXbLog) {
        return userChangeXbLogMapper.updateUserChangeXbLog(userChangeXbLog);
    }

    /**
     * 批量删除小过户记录
     *
     * @param ids 需要删除的小过户记录主键
     * @return 结果
     */
    @Override
    public int deleteUserChangeXbLogByIds(Long[] ids) {
        return userChangeXbLogMapper.deleteUserChangeXbLogByIds(ids);
    }

    /**
     * 删除小过户记录信息
     *
     * @param id 小过户记录主键
     * @return 结果
     */
    @Override
    public int deleteUserChangeXbLogById(Long id) {
        return userChangeXbLogMapper.deleteUserChangeXbLogById(id);
    }
}
